package asimes.leetcode;

/**
 * Created by Asimes on 2016/10/21.
 */
public class RemoveElement {

    public static int[] nums ;

    public static void main(String[] args) {
        nums = new int[]{3,2,2,3};
        int val = 3;
        int result = removeElement(nums,val);
        System.out.println(nums[0]+ " " +result);
    }

    public static  int removeElement(int[] nums, int val) {
        int len = 0;
        for(int i=0;i<nums.length;i++){
            if(nums[i] != val) len++;
        }
        return len;
    }
}
